﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModelManage.aspx.cs" Inherits="GreatB2C.Web.Manage.SystemSet.Contents.ModelManage" %>

<%@ Register Assembly="AspNetPager" Namespace="GreatB2C" TagPrefix="pager" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>内容模型管理</title>
    <link href="../../../App_Themes/AdminDefaultTheme/Guide.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/index.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/xtree.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/MasterPage.css" type="text/css"
        rel="stylesheet" />

    <script type="text/javascript" src="../../../Resource/Script/pagebase.js"></script>

    <link rel="stylesheet" type="text/css" href="../../../Resource/jqueryEasyui/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../../Resource/jqueryEasyui/themes/icon.css" />

    <script type="text/javascript" src="../../../Resource/jqueryEasyui/jquery-1.4.4.min.js"></script>

    <script type="text/javascript" src="../../../Resource/jqueryEasyui/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        function showMenu(menuid) {
            $('#menu_' + menuid).menu('show', {
                left: pointerX(),
                top: pointerY()
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="margin:4px;">
        <span style="display: inline-block; height: 20px;"><span>
            <img src="../../../App_Themes/AdminDefaultTheme/Images/localGIF.gif" align="absmiddle"
                style="border-width: 0px;" />后台管理 </span><span>&gt;&gt; </span><span><a>系统设置</a></span><span>
                    &gt;&gt; </span><span><a>模型管理</a></span><span> &gt;&gt; </span><span><a>内容模型管理</a></span></span>
    </div>
    <div style="margin:4px;">
        <table class="border" cellspacing="1" cellpadding="0" border="0" style="width: 100%;">
            <tr class="tdbg" align="center">
                <td valign="top">
                    <asp:DataGrid ID="dgData" CssClass="border" runat="server" Width="100%" HeaderStyle-VerticalAlign="Top"
                        AutoGenerateColumns="False" BorderWidth="0px" PageSize="15" AllowPaging="True"
                        OnItemDataBound="dgData_ItemDataBound" OnItemCommand="dgData_ItemCommand">
                        <PagerStyle Visible="False" />
                        <ItemStyle Height="25px" CssClass="tdbg" />
                        <Columns>
                            <asp:TemplateColumn HeaderText="操作">
                                <ItemTemplate>
                                    <div class="operatshortcut">
                                        <ul class="operatingMenu3">
                                            <li>
                                                <asp:LinkButton ID="lbtnUpdate" runat="server" CommandName="Update" CommandArgument='<%# Eval( "ModelID" ) %>' style="text-decoration: none;">
                                                    <span class="Picview"><img src="../../../Resource/Images/edit.gif" /></span>&nbsp;修改
                                                </asp:LinkButton>
                                            </li>
                                            <li class="operatingMenu2" style="cursor: pointer;">
                                                <img src="../../../Resource/Images/dropdown.gif" border="0" onclick=showMenu('<%# Eval( "ModelID" ) %>') />
                                            </li>
                                        </ul>
                                    </div>
                                    <div id='menu_<%# Eval( "ModelID" ) %>' class="easyui-menu" style="width:120px; display:none;">
		                                <div iconCls="icon-list"><asp:LinkButton ID="lbtnFields" runat="server" style="height:20px; line-height:20px;" CommandName="ListFields" CommandArgument='<%# Eval( "ModelID" ) %>'>字段列表</asp:LinkButton></div>
		                                <div iconCls="icon-lock"><asp:LinkButton ID="lbtnForbidden" runat="server" style="height:20px; line-height:20px;" CommandName="Forbidden" CommandArgument='<%# Eval( "ModelID" ) %>'>禁用</asp:LinkButton></div>
		                                <div iconCls="icon-cancel"><asp:LinkButton ID="lbtnDelete" runat="server" style="height:20px; line-height:20px;" OnClientClick="return confirm('删除模型将会把该内容模型所有的相关数据以及采集项目被删除，确定一定要删除此模型吗？');" CommandName="Delete" CommandArgument='<%# Eval( "ModelID" ) %>'>删除</asp:LinkButton></div>
		                                <div iconCls="icon-save"><asp:LinkButton ID="lbtnSaveAsModel" runat="server" style="height:20px; line-height:20px;" CommandName="SaveAsModel" CommandArgument='<%# Eval( "ModelID" ) %>'>存为模型模板</asp:LinkButton></div>		                                
                                    </div>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="ModelID" HeaderText="ID">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="ItemIcon" HeaderText="图标">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="ModelName" HeaderText="模型名称">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="Description" HeaderText="模型描述">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="ItemName" HeaderText="项目名称">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="TableName" HeaderText="表名">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="Disabled" HeaderText="状态" Visible="false">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="150px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:TemplateColumn HeaderText="状态">
                                <HeaderStyle Width="5%" />
                                <ItemTemplate>
                                    <%# (bool)Eval("Disabled") ? "<span style='color:Red'>禁用</span>" : "正常"%>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="60px" />
                            </asp:TemplateColumn>
                        </Columns>
                        <HeaderStyle VerticalAlign="Top" Height="25px" CssClass="gridtitle"></HeaderStyle>
                    </asp:DataGrid>
                    <asp:Literal ID="litNone" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr class="tdbg" align="center">
                <td align="center">
                    <pager:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" PageSize="12"
                        Width="600px" OnPageChanged="AspNetPager1_PageChanged" ShowCustomInfoSection="Left"
                        CustomInfoSectionWidth="220px" ShowPageIndexBox="always" PageIndexBoxType="DropDownList"
                        CustomInfoHTML="第<font color='red'><b>%currentPageIndex%</b></font>页，共%PageCount%页，每页显示%PageSize%条记录"
                        FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页">
                    </pager:AspNetPager>
                </td>
            </tr>
        </table>
    </div>
    </form>
    <asp:Literal ID="litScript" runat="server"></asp:Literal>
</body>
</html>
